import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
// 路由守卫
import {AuthRouterService} from '@kylin/core';
import {HomeComponent} from './home.component';

const homeRoutes: Routes = [
    {
        path: '',
        component: HomeComponent,
        children: [
            {
                path: 'front-page',
                loadChildren: () => import('./front-page/front-page.module').then(m => m.FrontPageModule)
            },
            {
                path: 'statistical-map',
                loadChildren: () => import('./statistical-map/statistical-map.module').then(m => m.StatisticalMapModule)
            },
            {
                path: 'personal-center',
                loadChildren: () => import('./personal-center/personal-center.module').then(m => m.PersonalCenterModule)
            },
            {
                path: 'platform',
                loadChildren: () => import('./platform/platform.module').then(m => m.PlatformModule)
            },
            {
                path: 'home-page',
                loadChildren: () => import('./home-page/home-page.module').then(m => m.HomePageModule)
            },
            {
                path: 'not-developed',
                loadChildren: () => import('./home-page/home-page.module').then(m => m.HomePageModule),
                canActivate: [AuthRouterService]
            },
            {
                path: '',
                redirectTo: 'home-page',
                pathMatch: 'full'
            },
            {
                path: '**',
                redirectTo: 'front-page',
                pathMatch: 'full'
            }
        ]
    }
];

@NgModule({
    imports: [
        RouterModule.forChild(homeRoutes)
    ],
    exports: [
        RouterModule
    ],
    declarations: []
})
export class HomeRoutingModule {
}
